package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

public class MyIntegralModel {

    public Observable<ResponseBody> getMeInfo(Context context) {
        Map<String, String> maps = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10006, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }

    /**
     * 积分签到
     *
     * @param context
     * @return
     */
    public Observable<ResponseBody> onSign(Context context) {
        HashMap<String, String> map = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10151, JsonUtils.requestJsonDate(map), Constants.tokenId);
    }

    /**
     * 补签
     *
     * @param context
     * @return
     */
    public Observable<ResponseBody> onMakeUp(Context context, String datetime) {
        HashMap<String, String> map = new HashMap<>();
        map.put("dateTime", datetime);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10152, JsonUtils.requestJsonDate(map), Constants.tokenId);
    }

    /**
     * 我的积分
     *
     * @param context
     * @return
     */
    public Observable<ResponseBody> onInfo(Context context) {
        HashMap<String, String> map = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10150, JsonUtils.requestJsonDate(map), Constants.tokenId);
    }

}